import React, { Component } from 'react'
import PropTypes from 'prop-types'
import './index.css'

export default class Footer extends Component {

  static propTypes={
    isSelectAll:PropTypes.bool.isRequired,
    count:PropTypes.number.isRequired,
    total:PropTypes.number.isRequired,
    selectAll:PropTypes.func.isRequired,
  }

  render() {
    const { isSelectAll,count,total,selectAll,deleteAllComplate } = this.props
    return (
      <div className='footer'>
        <label className='radio'><input type="checkbox" checked={isSelectAll} onChange={()=>selectAll()}/></label>
        <div>已完成 <span style={{color:'#e55b47'}}>{count?count:0}</span> / 全部 <span style={{color:'#e55b47'}}>{total?total:0}</span></div>
        <div className='delete_btn' onClick={()=>deleteAllComplate()}>删除已完成</div>
      </div>
    )
  }
}
